package com.dau.service.system.user.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dau.entity.system.user.SysRole;
import com.dau.mapper.mapper.role.SysRoleMapper;
import com.dau.service.system.user.SysRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色服务impl
 *
 * @author tzj
 * @date 2024/11/07
 */
@Service("sysRoleService")
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
    /**
     * 按用户id获取角色
     *
     * @param userId 用户id
     * @return {@link List }<{@link String }>
     */
    @Override
    public List<String> getRoleByUserId(Long userId) {
        return baseMapper.getRoleByUserId(userId);
    }

    /**
     * 通过用户id获取权限
     *
     * @param userId 用户id
     * @return {@link List }<{@link String }>
     */
    @Override
    public List<String> getPermissionByUserId(Long userId) {
        return baseMapper.getPermissionByUserId(userId);
    }
}
